/*
* Copyright 2004-2010 mb_sx@hotmail.com
* All Rights Reserved.
*/
using System;
using System.Windows.Forms;

namespace DeskNotes
{
	/// <summary>
	/// Summary description for DeskNotesTreeNode.
	/// </summary>
	public class DeskNotesTreeNode : System.Windows.Forms.TreeNode
	{
		static internal byte NOTE = 0;
		static internal byte CATEGORY = 1;

		protected bool edited = false;

		protected long id = 0;

		protected byte type;

		public DeskNotesTreeNode(string text) : base(text) { }

		public DeskNotesTreeNode() : base() { }
		
		/// <summary>
		/// Record ID from XML dataset.
		/// </summary>
		internal long ID
		{
			set 
			{
				id = value;
			}
			get 
			{
				return id;
			}
		}

		internal byte Type 
		{
			get 
			{
				return type;
			}
		}

		internal bool Edited 
		{
			get 
			{
				return edited;
			}
			set 
			{
				edited = value;
			}
		}

		virtual internal void ResetEdited()
		{
			edited = false;
			foreach(TreeNode node in this.Nodes)
			{
				((DeskNotesTreeNode)node).ResetEdited();
			}
		}

		

	}
}
